package com.iplant.aps.service.apsenum.aps;

/**
 * 排程类型
 *
 * @author YouWang·Peng
 * 2022-8-8 09:20:21
 */
public enum APSShiftPeriod {
	/**
	 * SCH
	 */
	Minute(1, "分"),
	/**
	 * APP
	 */
	Hour(2, "小时"),
	/**
	 * SCH
	 */
	Shift(3, "班"),
	/**
	 * APP
	 */
	Day(4, "天"),
	/**
	 * APP
	 */
	Week(5, "周"),
	/**
	 * APP
	 */
	Month(6, "月");
	private int value;
	private String label;

	APSShiftPeriod(int value, String label) {
		this.value = value;
		this.label = label;
	}

	/**
	 * 通过 value 的数值获取枚举实例
	 */
	public static APSShiftPeriod getEnumType(int val) {
		for (APSShiftPeriod type : APSShiftPeriod.values()) {
			if (type.getValue() == val) {
				return type;
			}
		}
		return APSShiftPeriod.Day;
	}

	public int getValue() {
		return value;
	}

	public String getLabel() {
		return label;
	}
}
